package com.lyncs.ods.modules.txn.service;

import com.lyncs.ods.common.api.CommonPage;
import com.lyncs.ods.req.ListPageSearchReq;
import com.lyncs.ods.req.SaveDeliverReq;
import com.lyncs.ods.resp.*;

/**
 * @author alex
 * @date 2022/2/26 18:46
 * @description
 */
public interface DeliverService {
    /**
     * 保存/修改 交付单
     *
     * @param req request info
     * @return
     */
    Long saveDeliver(SaveDeliverReq req);

    /**
     * search deliver info by page
     *
     * @param req request info
     * @return deliver info
     */
    CommonPage<ListPageResp> listDeliver(ListPageSearchReq req);

    /**
     * get deliver detail info
     *
     * @param deliverId deliver id
     * @return deliver detail info
     */
    DeliverDetailInfoResp getDeliverDetail(Long deliverId);

    /**
     * reverse deliver
     *
     * @param deliverId deliver id
     */
    void reverseDeliver(Long deliverId);

    /**
     * 交付单 置顶/取消
     *
     * @param deliverId deliverId
     * @param type      type
     */
    void stickyOnTop(Long deliverId, Integer type);

    /**
     * 账款结算历史
     *
     * @param deliverId deliverId
     * @param billId    billId
     * @return resp
     */
    DeliverSettleLogResp getDeliverSettleLog(Long deliverId, Long billId);

    /**
     * 交付单变更历史
     *
     * @param deliverId deliverId
     * @param page      page
     * @param pageSize  pageSize
     * @return logs
     */
    CommonPage<TxnEditLogResp> getDeliverEditLog(Long deliverId, Integer page, Integer pageSize);

    /**
     * 获取没有完全交付的订单sku
     *
     * @param sellerId sellerId
     * @param buyerId  buyerId
     * @param currency
     * @param orderId
     * @param page     page
     * @param pageSize pageSize
     * @return result
     */
    CommonPage<UndeliveredOrderSkuResp> listUndeliveredOrder(Long sellerId, Long buyerId, String currency, Long orderId, Integer page, Integer pageSize);

    /**
     * 交付单某sku交付历史
     *
     * @param deliverId
     * @param skuId     skuId
     * @return result
     */
    DeliverSkuLogResp getSkuDeliverLog(Long deliverId, Long skuId);

    /**
     * 交付单整单历史记录
     *
     * @param deliverId deliverId
     * @return resp
     */
    DeliverLogResp getDeliverLog(Long deliverId);
}
